<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<button-counter></button-counter>
            <Hello-World>></Hello-World>
			<hello-vue></hello-vue>
		</div>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	    <script type="text/javascript">
			Vue.component('HelloWorld',{
				data:function(){
					return{
						msg:'HelloWorld'
					}
				},
				template:'<div>{{msg}}</div>'
			})
	    	Vue.component('button-counter',{
				data:function(){
					return{
						count:0
					}
				},
				template:`
				<div>
				<button @click="handle">点击了{{count}}次</button>
				<HelloWorld></HelloWorld>
				</div>
				`,
				methods:{
					handle:function(){
						this.count += 2;
					}
				}
			})
			var HelloVue ={
				data:function(){
					return{
						msg:'Hello,vue'
					}
				},
				template:'<div>{{msg}}</div>'
			}
			
			var vm= new Vue({
				el:'#app',
				data:{
					
				},
				components:{
					'hello-vue':HelloVue
				}
			});
	    </script>
	</body>
</html>
